package zlatan_demo01

object ClassDemo01 {
  class Person{
     private var name:String=_  //私有化
     private var age:Int= _

    //定义成员方法
    def getName()=name
    def setName(name:String):Unit=this.name=name
    def getAge()=age
    def setAge(age:Int):Unit=this.age=age

    //私有的，sayHello
    private def sayHello():Unit=println("Hello,Scala")
  }

  def main(args: Array[String]): Unit = {
    val p =new Person()

    p.setName("张三")
    p.setAge(20)

    println(p.getName(),p.getAge())


  }

}
